package com.foredu.fiqs.persist.hibernate;

import java.util.List;

import com.foredu.fiqs.domain.Department;
import com.foredu.fiqs.domain.Employee;
import com.foredu.fiqs.persist.IEmployeeDao;

public class HibernateEmployeeDao extends HibernateAbstractDao<Employee, Integer>
		implements IEmployeeDao {

	private static final long serialVersionUID = 1L;

	public HibernateEmployeeDao() {
		super(Employee.class);
	}

	//通过empId教职工查找Employee对象
	@Override
	public Employee findByEmpId(String empId) {
		List<Employee> empList = this.getHibernateTemplate().find("from Employee e where e.empId = ?", empId);
		Employee emp = null;
		if (empList != null && empList.size() > 0) {
			emp = empList.get(0);
		}
		return emp;
	}


}
